
#ifndef XMAC_MSG_H
#define XMAC_MSG_H

#include "conf.h"


typedef struct temp_data {
	unsigned int source;
	unsigned int packet_number;
	int temp;
} temp_data;
#define MSG_SIZE_DATA_TEMP 6


typedef struct msg_data {
	unsigned int source;
	uint8_t type;
	uint8_t data_length;
	unsigned int destination;
	unsigned int packet_id;
	temp_data data[CONF_TX_QUEUE];
} msg_data;
#define MSG_SIZE_DATA_HEADER 8 
#define MSG_SIZE_DATA (MSG_SIZE_DATA_HEADER+CONF_TX_QUEUE*MSG_SIZE_DATA_TEMP)
#define MSG_TYPE_DATA 3

typedef struct msg_data_ack {
	unsigned int source;
	uint8_t type;
	uint8_t dummy;
	unsigned int destination;
	unsigned int packet_id;
} msg_data_ack;
#define MSG_SIZE_DATA_ACK 8
#define MSG_TYPE_DATA_ACK 4


typedef struct msg_preambule {
	unsigned int source;
	uint8_t type;
	uint8_t count_down;
	uint8_t destination_hop_count;
} msg_preambule;
#define MSG_SIZE_PREAMBULE 5
#define MSG_TYPE_PREAMBULE 1


typedef struct msg_preambule_ack {
	unsigned int source;
	uint8_t type;
	uint8_t source_hop_count;
	unsigned int destination;
} msg_preambule_ack;
#define MSG_SIZE_PREAMBULE_ACK 6
#define MSG_TYPE_PREAMBULE_ACK 2


#endif
